package com.sudoku.common;

import java.awt.Color;
import java.awt.Font;
import java.sql.Connection;

public class Constants {
	public static final String STATIC_DIR = "src/config";
	/**
	 * 数据库相关常量
	 */
	public static final String SQLITE_DB_URL = "config/sukodu.db";
	public static final String SQLITE_TABLE = "sudoku";
	public static Connection connection = null;
	
	/**
	 * 数独终盘种子
	 */
	public static final int[][] SEED = { 
	        { 5, 3, 4, 6, 7, 8, 9, 1, 2 }, 
			{ 6, 7, 2, 1, 9, 5, 3, 4, 8 },
			{ 1, 9, 8, 3, 4, 2, 5, 6, 7 }, 
			{ 8, 5, 9, 7, 6, 1, 4, 2, 3 }, 
			{ 4, 2, 6, 8, 5, 3, 7, 9, 1 },
			{ 7, 1, 3, 9, 2, 4, 8, 5, 6 }, 
			{ 9, 6, 1, 5, 3, 7, 2, 8, 4 }, 
			{ 2, 8, 7, 4, 1, 9, 6, 3, 5 },
			{ 3, 4, 5, 2, 8, 6, 1, 7, 9 } 
		};
	
	public static final int VALUE_EASY = 0;
	public static final int VALUE_INTERMEDIATE = 1;
	public static final int VALUE_DIFFFICULT = 2;
	
	public static final double RATIO_EASY = 0.9; // 简单模式下90%的格子已经给定
	public static final double RATIO_INTERMEDIATE = 0.7; // 普通模式下70%格子已经给定
	public static final double RATIO_DIFFICULT = 0.5; // 困难模式下50%格子给定
	
	public static final String LABEL_HOME = "HOME";
	public static final String LABEL_PUZZLE = "PUZZLE";
	
	public static final String LABEL_EASY = "EASY";
	public static final String LABEL_INTERMEDIATE = "INTERMEDIATE";
	public static final String LABEL_DIFFICULT = "DIFFICULT";
	
	/**
	 * 题目界面有关常量
	 */
	public static final int GRID_SIZE = 9;
	public static final int CELL_SIZE = 60;
	public static final int CANVAS_WIDTH = CELL_SIZE * Constants.GRID_SIZE;
	public static final int CANVAS_HEIGHT = CELL_SIZE * Constants.GRID_SIZE;
	public static final Color OPEN_CELL_BGCOLOR = Color.YELLOW;
	public static final Color CLOSED_CELL_BGCOLOR = new Color(240, 240, 240);
	public static final Color CLOSED_CELL_TEXT = Color.BLACK;
	public static final Font FONT_NUMBERS = new Font("Monospaced", Font.BOLD, 20);
	public static final Font FONT_WELCOME = new Font("Monospaced", Font.ITALIC, 36);
	public static final Font FONT_BUTTON = new Font("Monospaced", Font.PLAIN, 14);
	public static final Font FONT_INFO = new Font("Monospaced", Font.PLAIN, 15);
	public static final Font FONT_COPYRIGHT = new Font("Monospaced", Font.PLAIN, 16);
	public static final Font FONT_SUBTITLE = new Font("Monospaced", Font.PLAIN, 20);
	
	public static final String QRCODE_URL = STATIC_DIR + "/" + "qrcode.png";
	
	/**
	 * 存档最多显示数量
	 */
	public static final int HISTORY_NUM = 10;
	

}
